/*
 *
 * Copyright (c) 2025, NexIoT. All Rights Reserved.
 *
 * @Description: 本文件由 gitee.com/NexIoT 开发并拥有版权，未经授权严禁擅自商用、复制或传播。
 * @Author: gitee.com/NexIoT
 * @Email: wo8335224@gmail.com
 * @Wechat: outlookFil
 *
 *
 */

package cn.universal.admin.generator.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/** 读取代码生成相关配置 @Author ruoyi */
@Component
@ConfigurationProperties(prefix = "gen")
@PropertySource(value = {"classpath:generator.yml"})
@Profile({"beta"})
public class GenConfig {

  /** 作者 */
  public static String Author;

  /** 生成包路径 */
  public static String packageName;

  /** 自动去除表前缀，默认是false */
  public static boolean autoRemovePre;

  /** 表前缀(类名不会包含表前缀) */
  public static String tablePrefix;

  public static String getAuthor() {
    return Author;
  }

  @Value("${Author}")
  public void setAuthor(String Author) {
    GenConfig.Author = Author;
  }

  public static String getPackageName() {
    return packageName;
  }

  @Value("${packageName}")
  public void setPackageName(String packageName) {
    GenConfig.packageName = packageName;
  }

  public static boolean getAutoRemovePre() {
    return autoRemovePre;
  }

  @Value("${autoRemovePre}")
  public void setAutoRemovePre(boolean autoRemovePre) {
    GenConfig.autoRemovePre = autoRemovePre;
  }

  public static String getTablePrefix() {
    return tablePrefix;
  }

  @Value("${tablePrefix}")
  public void setTablePrefix(String tablePrefix) {
    GenConfig.tablePrefix = tablePrefix;
  }
}
